net: Check if returned pointer for allocated memory is NULL
authorAlec Brown <alec.r.brown@oracle.com>
Wed, 22 Jan 2025 18:04:44 +0000 (18:04 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Thu, 3 Jul 2025 16:35:51 +0000 (18:35 +0200)
commit943ca417f9a500879adceabb6db09ff10852f3b8
tree5c80009991dac5b41cbb7098159f158db6e60044
parentab91352c4af65a07f4e34c909921d37cccea9601
net: Check if returned pointer for allocated memory is NULL

When using grub_malloc(), the function can fail if we are out of memory.
After allocating memory we should check if this function returned NULL
and handle this error if it did.

Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name net-Check-if-returned-pointer-for-allocated-memory-is-NUL.patch
grub-core/net/net.c